package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.ClientLost;
import cn.wolfcode.crm.domain.StudentOfficial;
import cn.wolfcode.crm.query.StudentOfficialQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StudentOfficialMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StudentOfficial record);

    StudentOfficial selectByPrimaryKey(Long id);

    List<StudentOfficial> selectAll();

    int updateByPrimaryKey(StudentOfficial record);

    List<StudentOfficial> query(StudentOfficialQueryObject qo);

    int queryForCount(StudentOfficialQueryObject qo);

    //查询正式学员欠款金额
    StudentOfficial getOwnTuitionByClientId(Long id);


    //    改变休学状态
    void change2quit(Long id);

    //    改变转班状态
    void change2class(Long id);

    //    改变流失状态
    void change2lost(ClientLost cl);

    //改变学员状态(流失中--->已流失)
    void changeClientState(Long clientId);

    //改变学员状态(转班中--->正常)

    /**
     *
     * @param id    学员id
     * @param newClass  新课室ID
     */
    void changeClientClassState(@Param("id")Long id, @Param("newClass")Long newClass);


    //改变学员状态(反审核)
    /**
     *
     * @param id    学员id
     * @param oldClass  新课室ID
     */
    void unchangeClientClassState(@Param("id")Long id, @Param("oldClass")Long oldClass);

    /**
     * 当已交金额=总金额,改变状态
     * @param entity
     */
    void updateState(StudentOfficial entity);
}